Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@vaadin/vaadin-themable-mixin
Advanced tools
@vaadin/vaadin-themable-mixin is a mixin for creating themable web components. It allows developers to define custom styles and themes for their components, making it easier to maintain a consistent look and feel across applications.
Custom CSS Properties
This feature allows developers to define custom CSS properties that can be used to style components. The code sample demonstrates how to create a custom property for the background color of a component.
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
class MyComponent extends ThemableMixin(HTMLElement) {
static get is() { return 'my-component'; }
static get styles() {
return [
css`
:host {
--my-component-background-color: white;
background-color: var(--my-component-background-color);
}
`
];
}
}
customElements.define(MyComponent.is, MyComponent);
Theme Variations
This feature allows components to support different theme variations. The code sample shows how to apply different styles when a 'dark' theme is applied to the component.
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
class MyComponent extends ThemableMixin(HTMLElement) {
static get is() { return 'my-component'; }
static get styles() {
return [
css`
:host([theme~="dark"]) {
background-color: black;
color: white;
}
`
];
}
}
customElements.define(MyComponent.is, MyComponent);
LitElement is a base class for creating fast, lightweight web components with Lit. It provides a simple way to define custom elements and manage their styles. Compared to @vaadin/vaadin-themable-mixin, LitElement offers a more comprehensive solution for building web components, including templating and reactive properties, but it also supports theming through CSS custom properties.
Styled-components is a library for React and React Native that allows developers to use component-level styles in their applications. It uses tagged template literals to style components. While it is not specifically for web components, it offers a similar approach to theming and styling as @vaadin/vaadin-themable-mixin, but within the React ecosystem.
A mixin to enable customization of Shadow DOM used by Vaadin components.
This program is available under Vaadin Commercial License and Service Terms. For license terms, see LICENSE.
FAQs
vaadin-themable-mixin
The npm package @vaadin/vaadin-themable-mixin receives a total of 70,287 weekly downloads. As such, @vaadin/vaadin-themable-mixin popularity was classified as popular.
We found that @vaadin/vaadin-themable-mixin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.